package main;

import java.io.File;
import java.io.IOException;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import app.action.AppUtilities;
import app.ui.MainFrame;

public class MergeFilesTXT {

	public static void main(String[] args) {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (UnsupportedLookAndFeelException e) {
			e.printStackTrace();
		}

		MainFrame mainFrame;
		try {
			mainFrame = new MainFrame(getAppUtilities());
			mainFrame.setVisible(true);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	private static AppUtilities getAppUtilities() throws IOException {
		AppUtilities appUtilities = null;
		String className = MergeFilesTXT.class.getName();
		className = className + ".ini";
		String currentPath = System.getProperty("user.dir") + "/";
		File file = new File(currentPath + className);
		appUtilities = new AppUtilities(file);		
		return appUtilities;
	}
}
